fixed bug regarding initWithKey