fix too many tasks bug