Fixed UI related bugs

Fixed UI related bugs
You may need the same logic in the other handler.