Update sm_functions.js