added log messages for debugging