BugFixing with the chest
code and locked state are now saved