Moved command ending to caller