bot optimization (fix bugs)