fixed double declarations, db variables