fixed bugs in lock_date system