upload only when there are no errors. fixes #96
fix flash error