Fix bug of layout refresh error