solving problem with types derived from json