added some functions and events