Fixed NPE when creating network