bug fixing and adjusting layout