improve handling of hash
allowing for multiple event listeners