fixed bug with last delete after sort action