fixes bug with grabbing text from input fields