added log to main function