added log function for debugging