fixed issue with parameter scope