FIX: Fix finding last idx