updated keypress split code