improved *nix compatability

Signed-off-by: Quintus <devqqq@gmail.com>