Fix settimeout callback timing