fixing issues in event.preventDefault() and now it is working on firefox too