updated for better setup handling