Added argument checking logic