Added a timeout to fix ios bug