works but only on ubuntu with delay in ejs file