fix some bugs in entry management