fix setup routine