fix some auto sript bugs