delay js execution for 1 second