fix mysql gone bug; add main view layout