corrected invalid variable call & added log file debug information