fixed nb bugs