added javascript-driven wait message display logic