Add close functionality