Added ES exception handling