Update class.main.php