added functions and events