Finally fixed the portability