found a better way to check anonymous user