Added waits for, need to be improved thoug