cleanup, added log option