but fixing for undefined variable $log