nearly works last entries are missing