fix bugs for production