fix bug in last filter when filtering an empty array