check whether handler.close is callable too