added pre-loop action hook