setfullscreen moved at the end of func