added onRestoreInstanceState to preserve data when orientation change