now it work in both portrait and landscape orientations