Refactor to send_and_timed_select function
Fix issue with prompt parsing