added optional attach/detach event options