Fixed a bug in old api