brightness function  bug