improve task scheduler