Added type check for arguments