added some checks for user auth