modified task handling so that it doesn't repeat when it shouldn't