The figure shows a block (assumed to be a point) being pulled by an ideal string across an elevated pulley. At any time $t$, let the horizontal distance of the block be $x$ from the pulley. The length of the string is $l$ and the height of the pulley is $h$ from the ground. The string is pulled with a speed $u$ as shown. Using calculus I found the speed of the block to be $u \sec \theta$ (where $\theta$ is the inclination of the string with the horizontal) which is given as the correct answer.
So my doubt is: why can't we simply resolve $u$ along the horizontal and say the block's speed is $u \cos \theta$? It doesn't seem wrong to me but isn't correct for some reason. Could someone please explain why?