Update common-functions.js

Minor bug fix