added return statement for define templates and removed double brackets