added os check to create valid filename for windows