fixed bug on Pi