fix silly bug on kbd function