fix sec bugs