Add a close method to the prompt.