fix javascript errors

two files cannot have same name functions