Dev

fix some critical bugs for cases when the public key wasn't found