jquery only works on second click :/