removed a tolower which caused problems; still the handle can not be properly released. for later