updated functionality so users cannot edit others profile or see pages if not logged in