add tests and fix bugs on joinpoint. advice left