Resolve jquery bug, calling it from the footer