bug fix and allows to set key