fixing bug with init