Bug fix that CloseView doesn't work properly