Prevents race condition when using pipe
Should probably use variables for this