added validation of arguments