Add secure middleware