Add three level and bug fix