changed to pageinit for js to fire once