fix a bug of displaying remaining amount in callback function