proper placement of jquery actions