fix bug in delete key event