fix issue with destroying keys