fix device light error from being inside if