debugging TypeMismatchError: DOM Exception 17