Stupid bug. Sate not being saved