Moved the document ready function