added a protection against multiple registration of the same task