fix PIL issue