Ajax exception bug fix