handle multiple entries correctly