moved jquery if statement to bottom