better error handling on duplicate hash