fixed some layout bugs