added check for too few and too many arguments