change where close() gets called