fixes a "key not valid" bug