moved function declaration out of block #4764