added rehash for terminal