Fixed setup function