add support for savestates