Added custom close operations to the window