fixed error on delete when empty