implemented datewriteing to the local database
corrections