only preventDefault() conditionally