Upgraded version for K4Bot