add PIL
fix runtime thrown errors