must pass user in function