sync with libtom