updated according to pr comments