refactor and fixed server error
Merge remote-tracking branch 'origin/master'