fix bidmat script