implemented login check to register