make sure $tags is not undef