fix bug with constructor