add a check for sparse->dense conversion