Fix bug browser bug with removing search fields

http://stackoverflow.com/questions/17059385/referenceerror-event-is-not-defined-in-mozila-firefox