md5 variable scope problem