better handling of bad profiles