Added wait to update_indexes invocation