fixing gson

fixing gson serialization to work with any container