JC: Removed extra if loop in view.