add function to get pending input