texture: corrected implementation