fix an issue with watch task where the re-compilation was trigged multiple times