Perhaps you could give us a chance to help you ... by copy-pasting whatever the actual code you're actually executing... and a sample of your error messages.
What you've posted so far is so full of typos and illogical code as to be almost incomprehensible.
If I've misconstrued your question or the logic needed to answer it, I offer my apologies to all those electrons which were inconvenienced by the creation of this post.