implemtn defence functions