no more grossness by using setstate callback