fixed bug when a param is nil