fix bugs when running on linux