fix bugs. work on change orientation