Modified to support different  OS