finalised fix from this mac osx and flock. #fixes 10