fix bugs and change init methods