Fix for last rows issue