fix bugs for linux build