applied setlayout fix