before scheduler