Handling lock error