improved error handling for db setup