conditionally create device