fix to be compatible with imputed data