Add close functionality to the WindowService