adding foreach in registrator_action.php