some useful function