Remove asInstanceOf usage sending an EventWithWrites