Call a function only once during a settimeout