my asynchronous function is showing promise pending