Variation of energy level alignment in molecular junction elongation