Input field integer value verification issue in IOS Safari

Hi guys, ihave an issue with the code. The code verifies birth year of a visitor in the input with id #ageinput, and if its equal or less than 2003 - then it will not redirect. However the code does not execute on Safari IOS… Please help, Im not too experienced in Wix code and would appreciate your help. Also, maybe there is any other workaround?
Here is the code:

 import wixLocation from 'wix-location';

export function ageinput_input(event) {
 let input = parseInt($w("#ageinput").value);

if (input <= 2003 && input > 1901) {
 wixLocation.to("/home");
}

}

Thanks,
Max.