changed rest param declaration handling to fix a bug