fixed up the security checking