fixed optimization issues with big networks