added check to prevent default element action from firing