avoid classcastexception on failure