modify to check number of arguments