added parseTag method