added ability to log in after registration and other cleanup