fix bugs at multiple use