Get rid of asInstanceOf in play-functional