improve form input handling