This code contains implementation of timeout and delay logic for application 1