Nit: no need for the extra space before function and after the closing } in the timeout here.