add null check in setParam