Fixes UI handling issues