fixed issues when screen orientation changed