added some global functions