Changed document ready to document on pagecreate