changed username to userId in business logic