fixed parsing errors correctly