fix error and make it work on linux