get fields to behave in scala