added more argument validation