Added method to insert to database