handle client and fix few stuff