auto detection of the right schedule