fix #26, handle input fields correctly