fix definition of dict after function definition