Added keypress callback to handle fields