fixed var args bug and optional arg bug