Corrected error handling in setup.js