fix return string error; improve codes;