added log and fixed minor issues