fixed bug with `with` fn