Debug logging added