fixed bidmat script for Mac