Added restriction registerListener

Fixes #1878