fix bug in servers and add flag for script on main