added some util functions