added some common functions