Correcting error with keys