bug fixes with invalid user input