fixed portability bug