fix bugs
fix tests