fixing bug in passing params