implement and found a bug