Since this module runs a task this should set a flag to avoid race conditions.