changed page loading code