Fixed bug in Linux and Windows