improved error handling for the gaston