Fix race condition between exec