flush output before prompting for input
Merge pull request #6 from ChungwaSoft/master

Applied patch from fjaeger.