fix close delay problem