bugfix

declared variable too late, updated