fix schedule join query