fix bug with data initialization