fix support for custom .engine function