Added close functionality.