ticket #6 fix errno, thought it was a variable