added additional check for mandatory arguments