Fixes reversed promises bug