fix race condition returning from catch