added cross-platform support