added debug and secure support