Fixed auth check