build actor class recursively. Fix #1267