corrected js sequence