server substring fix