hopefully fixed race condition in mail composing script