Fixed bug in schedule