fix bugs and can use in linux
remove unused