added code to restore database