Took objects out of the dom ready method to execute code