added a new function to lock and unlock the body