added log in case of exeption