It would help to post your code you are using in the function and how you are calling it. You leave EVERYTHING open to speculation...