fix bugs for first deploy