changed javascript ordering