add test for calling end > 1 time