Check if the dock exists before hiding