IDEX-1666: moved callback result cast to local variable