implements #386