fix cast issue for unix