fixing range issue  and PID
: