JAMS: implement idle task and some other things