Added option to not execute task twice