fix cleanup issue when key not specified