nullpointer on empty mdtag fix