fix bug in set-key