Updating PR8015 with better exception handling