fix bug, wrong place to declare