Code updated. Database and eventEntry
Code updated