fixed bug which caused add_task to fail