Fixed Javascript overwrite error