added some init logic