fix for invalid IDs - close #759