adding 999ms in stead of 1000 to avoid issue of rendering with extra second in certain cases