bug fix on needkey event