add ui for changing state of context to closed. This fixes #645