Trying to make getCanvasThenNext function