resolve issue with leaf context