Fixing the duplication bug. Now issue with last row empty