fixed issue#36, state will be saved between portrait and landscape mode