Edit mapFactory to reject promise if err instead of just console.log