fixed error handling in setup