check if database exists before dropping