Added a foreach to process all controller input