Improve raspberry dectection code