added method to login