fixed coding error

Now properly checks the number of argument