fix argument checking