fixed a bug with init