insert and update methods added to DB.php