Delay mechanism improved. Fixed minor syntax issue (bashism)