to safeguard the user input, the conditional checks if input is int