Stress reduction in planar waveguide using polymer top layer