fix bugs for v 2