made some changes for adding events into db