Found the problem: TODO: remove the logic from view; move to the controller