Patch 7

ignore other pull requests, this mayor pull should align linux code with windows code.