changed null to user.id