Fix bug in add commit.