Add source tree
Fix bug