TOok out forever loop. Works correctly now. Tested on pi