fixed bug with checking arguments