Safe guard added for int input