Index must checked for integer type before add to it.
When used in fields for @index gets corrupted and have string value of 
new resource.