Also I'm not 100% sure you need the asInstanceOf[P]; we didn't have it before.