lock variable after create it