make missing value detection more robust