fixed errors in common.js