DOMReady function wrapped in if statement