fixed variable naming
Change to catch errors rather than handle rejected promises