implement scheduler