fixed bugs of argument checking