fix E_NOTICE error

fix E_NOTICE error for tools.php