handling error with saving 'leases' file