fix register/login query