added a database and flash messages