added some functions in services