Fix to handle unexpcted errors