A novel laboratory experiment is used to show that mismatching between task preferences and task assignment undermines worker productivity and leads to free riding in teams. We elicit task preferences from all workers. Workers' endogenous sorting into tasks significantly improves productivity...