various bugs and some layout