Added test for task when