fix portability better way