adds end to def