Added support for close into dock and reopen