Update JS functions

Fix table load logic