final tweaking for code lock