I was not checking the input values before