workflow improved: doesn't ask for login if result is ERROR
major rewrite. all tests passing