fixed pin read bug