fixed some bugs and display issue