checking if async is returning undefined