implements #958