Fix attribute error when no tags present