fix warning ('ret' may be used uninitialized in this function)