fixed some bugs in schedule creating