Use mapTo instead of asInstanceOf.