replaced document ready with pageinit