Renamed variable.
Fixed id check.