Changes to input code to preventdefault