Fixes issues on orientation change