resolving Scala errors