fixing fatal: reference is not a tree