some helper codes added