fixed a bug in main nn