correcting malformated parsing