fix to call correct callback when netwrok error