added some end commands