check arguments and if they wrong throw exeption