error checking updated for user input