Adding a close fn.