fixed indexOutOfBoundException with lazy val