some portability fix