fix afterActions in Scala