add support for recusion flag