bugs and UI fixes