Properly register and unregister keyboardnotification listener