fixed some UI bugs, some gui refactoring