fix a bug in adding multiple entries