Added DB functionality