fixing deprecated issue with case class