fix setup script order bugs