PASDK-577:Move local var declarations outside if()