fix some bugs for linux