fixed bug when writing out pos tags