input redirection works, but ends program immediately.