added the code for db entry and db creation