fixed errors in provider.js