Fix bug on server. Improve config on client