add default timeout and encode judge

add default timeout and encode judge