Fix error check for linux