cleaned up keystore shutdown