added events and fixed callback for startup