i2c functions were creating file handles without closing them. fixed that.