fixes to pin.js