Exit if the wait does not succeed