adding support for corner cases when parsing larger dirty files