Added Login and registration functions