bug fixes on nnetwork