setTimeout to make sure the first loop happens after signal is returned to the user