small fix for main loop and spi