Added error check to make sure user enters an integer