add ajax exception handling