fixed bugs in key editor