Added a preventDefault function, tested and fixed issues accross latest firefox/safari/chrome