fixing err file creation