added os check for flock