fixed bidmat script