added range handling to delete