For some reason the lock was not efficient, using sleep(in) again.