Added login and registration func