fix a bug and add comment