fixed nill bug