update the data base integration. Now a new embedding does not take place after restoring from database. Also fixed code formatting issues.