[javascript] Call a function after previous function is complete