add exception code when calling bot script.