Fixed a bug where the front page is breaking.
Take the events data and save to the database. and load the events from database.