def fix login and registration