fix parsing bugs