added onSaveInstanceState and onRestoreInstanceState