added security middleware