Update lib/scripts.php