Added debugbar config
Updated error handling