fix putting the mode back. I merged it to the wrong place