outer class serialization problem fixed by moving inner class to outer