rewrote all db files into prepare stmt