change to serializable instead of generic