added protections to pins