Fixing javascript issues after jquery loader modifications