fix bug in schedule