Revise lock. Truncate should be fixed later