fix setup function