added log on error