display devices only if it is necessary