Added DB connection to views and controller