On the shape of the dynamic structure factor in glasses