fix context class cast exception in MillennialAdapter