fixed mail on error or completion command