Moved jquery method up