Rpi-backlight not working in a function

I added the command to /etc/rc.local and it's all good now