fix syntax errors in DB layer