Javascript orders fix