Added a test for secure editing, fixed secure issue bug