fix for Allowed memory size of xx bytes exhausted while reading big files