fixed bug in loading keys