Move order of promises functions