I think this wait is not working as expected