fix load_on_demand toggle timing for ajax loading failed
add handler for error on demand loading