database isn't being cleaned properly