Fixed bug with last entry