close and wait for the next entry