added more error catching for async promises