fix bug, expand to cover more use cases