added a wait, so cookie could cache