Definition external rectangle not working