You should use issparse.