Fixing db-function deletePage