Updated wait method to look for div