fix bugs for compile