fixed argument checking bug