add curly brace end to lock function that was oddly removed at one point.