JS Overwrite: prevent conflict if function is overwrite