fixing callbacks on network events