replaced custom msg with cast