correctly using param instead of local copy