changed document ready to pageinit