fix issues in lease save related to unit test