do the settimeout in the right place