parsing logic corrections