added pre-loop action hook & conditional