fixed NN bugs