Added setup function and check for previous setups