fixed cross platform issues