Fixing if database deleted or not created