fix for bad key access