correct some errors due to environment change