fixed a bug for creating sag recursively