fixed up database plugin