moved .preventDefault into function calls like requested.