fixed some bugs for linux