added a preventDefault method.