added page loading from database, not perfect yet