add support for lifecycle callbacks