fixed bugs and ui problems