Hmm..
Can you post the whole code(s) and actual configs?
Must be something else the problem other than the lines shown.