Modified to react to failed states