improved client handeling