Fix config.js and add exception handler