implementing Serializable to make attributes serializable