added secured pages
moved check_login back