Fixed lock problem