fixing rpi cleanup, added debug code