Fix Security Logic