added sema for recursive calls