it was a bug in my original code, and it is fixed now.