update Library Generate.php to fix bug