added login and registration functions