Fixed misplaced preventDefault that was causing issue #7