[resolved]trouble with macro

I am tsting the ability to create a recording and then write the file into a directory that has the contect name as part of the directory. The name of the file is rcrdxx, where xx is replaced with an incremented stored int he AST-DB. Here’s the macro:

[record-prompt]
exten => s,1,Wait(1)
exten => s,n,Playback(pls-rcrd-at-tone)
exten => s,n,Set(PROMPT=${DB(global/prompt-count)})
exten => s,n,Record(/etc/asterisk/${MACRO_CONTEXT}/rcrd${PROMPT}:wav)
exten => s,n,Set(PROMPT=$[${PROMPT} + 1 ])
exten => s,n,Set(DB(global/prompt-count)=${PROMPT})
exten => s,n,Playback(/etc/asterisk/${MACRO_CONTEXT}/rcrd$[${PROMPT} - 1 ])
exten => s,n,Wait(1)
exten => s,n,Hangup()

The problem is that the file gets written in the /etc/asterisk directory. The asterisk console gives the following messages. As you can see, the $MACRO_CONTEXT is being substituted with a blank instead of the context name. Any ideas?

-- Executing Goto("SIP/xxxxxxxxxx-1b82", "record-prompt|s|1") in new stack
-- Goto (record-prompt,s,1)
-- Executing Wait("SIP/xxxxxxxxxx-1b82", "1") in new stack
-- Executing Playback("SIP/xxxxxxxxxx-1b82", "pls-rcrd-at-tone") in new stack
-- Playing 'pls-rcrd-at-tone' (language 'en')
-- Executing Set("SIP/xxxxxxxxxx-1b82", "PROMPT=8") in new stack
-- Executing Record("SIP/xxxxxxxxxx-1b82", "/etc/asterisk//rcrd8:wav") in new stack
-- Playing 'beep' (language 'en')
-- Executing Set("SIP/xxxxxxxxxx-1b82", "PROMPT=9") in new stack
-- Executing Set("SIP/xxxxxxxxxx-1b82", "DB(global/prompt-count)=9") in new stack
-- Executing Playback("SIP/xxxxxxxxxx-1b82", "/etc/asterisk//rcrd8") in new stack
-- Playing '/etc/asterisk//rcrd8' (language 'en')
-- Executing Wait("SIP/xxxxxxxxxx-1b82", "1") in new stack
-- Executing Hangup("SIP/xxxxxxxxxx-1b82", "") in new stack

== Spawn extension (record-prompt, s, 9) exited non-zero on ‘SIP/xxxxxxxxxx-1b82’

is not a macro. [macro-record-prompt] would be a macro and the ${MACRO_CONTEXT} variable would be set.