got the script working. Had to change the d$ to d$$ for it to work.