adding front-end widget code