Fixed security bug with security and pid folders