write flashMessage and return it instead of the alert

@zspencer, this covers issue #19