Fixed empty array error in Security helper