fix bugs
fix bugs nearly done