construct function fixed