changed flag f.conn to err