Added Code for database stuff