Added a lock parameter that prevent user from modifying the value