prevent task execution in a wrong directory