update main_functions.js