Add better failure handling