Instead of commenting the 'close' here why don't you try commenting the functions called on the close function itself and see which one is causing the issue?