auto get db name
fix swap calculate