added some auth checks to check if logged in