minor format issue and error handle