Fix key retrieving