@javihernandez, is there a reason you are using sync version of exists? I wonder if the set operation would work just fine if it was entirely asynchronous (including the write file that is done at the end of this file). This will also let you get rid of wait utility that you have above.