split off send_keys function