fix bug in initialization