fix broken copy_backward algorithm