made a check if the user is logged in and redirect him to te homepage