rectifying db errors