Added else statement to end program if input is invalid.