add function sum, and do some adjustment about getcommond