Changed the document ready function