setting and restoring the screen brightness