Added check for return value of await