added --secure switch