fix bugs in merchant class