Wait for a property to be true. This really could be made into  a single function that calls a function and waits for a return etc. So much copy paste