fix some problem and lua file configurable
format adjust