Created if to validate temp

Created an if statement to validate the user input stored in the temp
variable