Adding end statements to management commands