fixing crash in situation where there are no tags