Added restriction for onConfigurationChanged

Closes #1201