It looks to me that your problem is that your subroutine requires a parameter value. You either need t get rid of it and find another way to get the parameter value, or have another sub that set the dictionary and passes it to your sub.