updated bidmat script