Further checking added to functions