Added new function for debugging and defined db_insert