fix setup logic