First remove from cache and then unregister hash
Removed unnecessary function argument