added cross platform compatibility