Directed Pickup Problem

Hi
Any help would be helpful, I’m new to Asterisk so please bare with me.

I have Asterisk 1.4.20.1 installed.

All is working ok but when I try to use directed pickup of a ringing extension I get the following error.

NOTICE[32760]: app_directed_pickup.c:159 pickup_exec: No target channel found for 1650.

I am using pickupmark and it appears to set it to the correct extension, the lines in the script are as follows

[queueanswer]
exten => _XXXX_X,2,Set(PICKUPMARK=${EXTEN:0:4})

then in my extensions.conf I have in the intenal context
exten => _#XXXX,1,Pickup(${EXTEN:1}@PICKUPMARK)
exten => _#XXXX,n,Hangup()

Thanks