work on p12 with threading stuff