added support for relations depth and custom events