update brightness fuction