fix index javascript to handle null sloc