The approach seems to work here. Could you post an executable code snippet, which would reproduce the issue you are seeing?