Updated the setting of errors so it doesnt enter the session for ajax requests