bug fix in key