fix testcase and add setter instead of constructor